package com.ruoyi.form.enums;

import cn.hutool.core.util.ObjectUtil;
import lombok.Getter;

import javax.annotation.Resource;

@Getter
public enum RecordStatusEnum {

    WAIT(0, "待执行"),
    RUNING(1, "正在执行"),
    FINISH(2, "执行结束")
    ;

    Integer value;
    String name;

    RecordStatusEnum(Integer value, String name){
        this.value = value;
        this.name = name;
    }

    public static String getNameByValue(Integer value){
        for (RecordStatusEnum item: values()){
            if (ObjectUtil.equal(item.getValue(), value)){
                return item.getName();
            }
        }
        return value+"";
    }
}
